<?php
namespace backend\controllers;

use app\models\Repay;
use Yii;
use yii\web\Controller;


/**
 * Site controller
 */
class RepayController extends Controller
{
    public $enableCsrfValidation = false;
    //代付统计
    //开始时间=还款日+1天
    public function actionRepaylist()
    {
        $model = new Repay();
        $res = $model->census();
        if ($res['code'] == 200) {
            return json_encode($res);
        } else {
            return json_encode(['code' => 401, 'message' => '没有找到资源！', 'data' => '']);
        }
    }

    //代付详情
    public function actionRepaydetail()
    {
        $post = Yii::$app->request->post();
        $model = new Repay();
        $res = $model->detail();
        if ($res['code'] == 200) {
            return json_encode($res);
        } else {
            return json_encode(['code' => 401, 'message' => '没有找到资源！', 'data' => '']);
        }
    }
}
